package com.wpx.Service.Impl;

import com.wpx.Mapper.ParagraphMapper;
import com.wpx.Pojo.Paragraph;
import com.wpx.Service.ParagraphService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ParagraphServiceImpl implements ParagraphService {

    @Autowired
    public  ParagraphMapper paragraphMapper;
    @Override
    public List<Paragraph> getParagraphList(Integer articleId) {
       List<Paragraph>lp=   paragraphMapper.getParagraphList(articleId);
        return lp;
    }

    @Override
    public void updateImages(List<Paragraph> lp) {
        for (Paragraph paragraph : lp) {
            paragraphMapper.updateImage(paragraph.getId(),paragraph.getImageUrl());
        }
    }
}
